Maintenance june26#92
Conversation
getFollowUpReplies built the replies DataFrame with pd.DataFrame(all_replies) and no explicit columns. When no student had replied (all_replies == []), that wrote a column-less CSV (just a newline); _loadFollowUpReplies then re-read it with pd.read_csv and raised EmptyDataError, so the intended "No student replies to assess." guard in assessFollowUpReplies was unreachable. Add a REPLIES_COLUMNS class constant (mirroring ASSESSMENTS_COLUMNS) and pass it to the DataFrame so the file always carries a header row. The empty case now round-trips to an empty frame and the guard fires. Column order is unchanged for the non-empty path. Adds a regression test (TestFollowUpRepliesEmptyRoundTrip) covering the no-reply round-trip, which the suite previously did not exercise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CanvigatorCourse.__init__ built the data/figures subdirectory inline as
course_code.split('-')[0] + course_code.split('-')[1] + ..., which raised
IndexError for any course_code lacking at least two hyphen-separated parts
(e.g. 'MATH101' or 'CS 3120 Spring 2026'). Because this runs in __init__, it
blocked every task for such a course — inconsistent with _shortCourseLabel /
_composeConversationSubject, which already handle those codes gracefully.
Extract the logic into a module-level _courseCodeToPath() helper that keeps the
exact canonical mapping (CSI-3300-001-12345 -> /csi3300_12345, verified
byte-identical to the old code so existing course directories are unchanged)
and falls back to a sanitized form of the whole code when there are fewer than
two hyphen-separated parts. None/empty codes are handled too.
Adds TestCourseCodeToPath covering the canonical, no-hyphen, space-separated,
two-part, and None/empty cases.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d50a179781
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| whole code so course selection never crashes on an unusual code. Spaces are | ||
| stripped from the result in all cases. | ||
| """ | ||
| code = str(course_code or '').strip() |
There was a problem hiding this comment.
Keep blank course codes out of root data path
When Canvas returns a blank or None course_code, this normalization turns it into '', and the helper returns "/"; CanvigatorConfig.addCourseToPath then strips that to an empty directory name and leaves data_path/figures_path at the shared data and figures roots. In that scenario, exports and later find_latest_csv lookups for the course are no longer isolated from other courses' files, so a missing Canvas code can mix or read the wrong course artifacts instead of getting a unique fallback directory.
Useful? React with 👍 / 👎.
No description provided.